<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'auth', 'namespace' => 'App\Http\Controllers\Auth'], function () {
    Route::post('login', 'AuthController@login');
    Route::post('logout', 'AuthController@logout')->middleware(['jwt.auth']);
    Route::post('resetPassword', 'AuthController@resetPassword')->middleware(['jwt.auth']);

    Route::group(['prefix' => 'permission'], function () {
        Route::get('tree', 'PermissionController@tree')->middleware(['auth:admin']);
    });

    // 管理端菜单权限
    Route::get('adminMenus', 'PermissionController@wmpHomeMenus')->middleware(['auth:admin']);

    Route::get('role/all', 'RoleController@all')->middleware(['auth:admin']);
    Route::resource('role', 'RoleController')->middleware(['auth:admin', 'permission:system.permission.role|parking-lot.permission.role|merchant.permission.role'])->only(['destroy', 'show', 'store', 'index']);

    // 商户登录
    Route::post('merchantLogin', 'AuthController@merchantLogin');
});
